﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Services.Identity.Domain.Entities;

namespace Services.Identity.Infrastructure.Configs;

public class UnsentUserConfig : IEntityTypeConfiguration<UnsentUser>
{
    public void Configure(EntityTypeBuilder<UnsentUser> builder)
    {
        builder.ToTable("T_UnsentUser");
        builder.HasKey(x => x.UnsentId).IsClustered();
        builder.Property(x => x.UnsentId).UseHiLo();
        builder.HasIndex(x => x.UserId);
        builder.HasQueryFilter(x => x.IsSent == false);
    }
}
